<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="天地图"/>
    <title>天地图－地图API－范例－地图放大和缩小</title>
    <script src="lib/tianditu-4.0.js"></script>
    <style type="text/css">body,html{width:100%;height:100%;margin:0;font-family:"Microsoft YaHei"}#mapDiv{width:100%;height:800px}input,b,p{margin-left:5px;font-size:12px}</style>
    <script>
        var map;
        var zoom = 10;
        function onLoad() {
            //初始化地图对象
            map = new T.Map("mapDiv");
            //设置显示地图的中心点和级别
            map.centerAndZoom(new T.LngLat(106.76995, 25.97901), zoom);
        }
    </script>
</head>
<body onLoad="onLoad()">
<div id="mapDiv"></div>
<div>
    <input type="button" id="button1" onClick="map.zoomIn()" value="放大地图"/>
    <input type="button" id="button2" onClick="map.zoomOut()" value="缩小地图"/>
</div>
</body>
</html>
